/**
 * 作者: wgx
 * 日期: 2024-10-25 09:51:45
 * 备注: 用户城镇摆放坐标数据
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.protocol.Common.PBUserCityCoord;
import com.motu.monstercity.server.game.logic.BuildManager;

public class UserCityCoord extends UserCityCoordModel {
    public UserCityCoord() {
        super();
    }

    public UserCityCoord(long userId, long crood, int itemId, int isTurn, String param, long buildTime) {
        super();
        putUserId(userId);
        putCrood(crood);
        putItemId(itemId);
        putIsTurn(isTurn);
        putParam(param);
        putBuildTime(buildTime);
    }

    public PBUserCityCoord.Builder takeBuilder() {
        PBUserCityCoord.Builder sb = super.takeBuilder();
        sb.setX(BuildManager.takeCoordXYZ(getCrood(), "X"));
        sb.setY(BuildManager.takeCoordXYZ(getCrood(), "Y"));
        sb.setZ(BuildManager.takeCoordXYZ(getCrood(), "Z"));
        return sb;
    }

    public PBUserCityCoord.Builder takeInitBuilder() {
        PBUserCityCoord.Builder sb = super.takeInitBuilder();
        sb.setX(BuildManager.takeCoordXYZ(getCrood(), "X"));
        sb.setY(BuildManager.takeCoordXYZ(getCrood(), "Y"));
        sb.setZ(BuildManager.takeCoordXYZ(getCrood(), "Z"));
        return sb;
    }
}
